import miao.demo.config.SpringConfig;
import miao.demo.domain.Account;
import miao.demo.service.AccountService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
/*
    目标：掌握Spring整合Junit
         1. 导入坐标 spring-test
         2. @RunWith(SpringJUnit4ClassRunner.class) 设置需要配合的Junit
         3 @ContextConfiguration(classes = SpringConfig.class) 设置需要配合的Spring
 */
public class App {
    public static void main(String[] args) {
        ApplicationContext ctx = new AnnotationConfigApplicationContext(SpringConfig.class);
        AccountService accountService = ctx.getBean(AccountService.class);
        Account account = accountService.findById(1);
        System.out.println(account);

    }
}
